home *** CD-ROM | disk | FTP | other *** search
- Listing 2 - The ARM's example illustrating restrictions on
- member functions in local classes
-
- int x;
- void f()
- {
- static int s ;
- int x;
- extern int g();
-
- struct local {
- int g() { return x; } // error:
- // 'x' is auto
- int h() { return s; } // ok
- int k() { return ::x; } // ok
- int l() { return g(); } // ok
- };
- // ...
- }
-
- local* p = 0; // error: 'local' not in scope
-
-